//
//  BankMapTableViewCell.m
//  SZBank
//
//  Created by LuoYao on 16/7/16.
//  Copyright © 2016年 LuoYao. All rights reserved.
//

#import "BankMapTableViewCell.h"


@interface BankMapTableViewCell ()
{
    UILabel *_name,*_address,*_phone;
    UIImageView *_indexImageView;
}
@end
@implementation BankMapTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 170)];
        backView.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
        
        [backView addSubview:self.bankName];
        [backView addSubview:self.bankPhone];
        [backView addSubview:self.bankAddress];
        
        [backView addSubview:_phone];
        [backView addSubview:_name];
        [backView addSubview:_address];
        [backView addSubview:_indexImageView];
        
        
        [self addSubview:backView];
        
        
    }
    return self;
}


#pragma mark - getter

- (UILabel *)bankName{
    if (!_bankName) {
        _bankName = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.4, 10,self.frame.size.width * 0.55, 50)];
            
            //indexImageView
            _indexImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.05, 10, self.frame.size.width * 0.15, 50)];
            _indexImageView.image = [LocalDataManager getImageWithSourceOfPath:@"地图_列表图标"];
            
            //label
            _label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 30, 30)];
            _label.textColor = [UIColor whiteColor];
            [_indexImageView addSubview:_label];
            
            //name
            _name = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.2, 10, self.frame.size.width * 0.2, 50)];
            _name.text = @"名称：";
            
            lb;
        
        });
    }
    return _bankName;
}

- (UILabel *)bankAddress{
    if (!_bankAddress) {
        _bankAddress = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.4, 60,self.frame.size.width * 0.55, 50)];
            lb.numberOfLines = 0;
            
            _address = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.2, 60, self.frame.size.width * 0.2, 50)];
            _address.text = @"地址：";
            lb;
            
        });
    }
    return _bankAddress;
}

- (UILabel *)bankPhone{
    if (!_bankPhone) {
        _bankPhone = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.5, 110,self.frame.size.width * 0.55, 50)];
            
            _phone = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 0.2, 110, self.frame.size.width * 0.2, 50)];
            _phone.text = @"电话：";
            lb;
            
        });
    }
    return _bankPhone;
}
@end
